package com.wd.common.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding
import com.gyf.immersionbar.ImmersionBar

/**
 * 作者：马海钊
 * 时间：2024/5/26 19:57
 * 功能：
 */
abstract class BaseActivity <VB : ViewBinding>:AppCompatActivity() {
    private lateinit var _binding:VB
    protected val binding get() = _binding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        _binding=getViewBinding()
        setContentView(_binding.root)

        ImmersionBar.with(this)
            .statusBarAlpha(0.4f).init()

        initData()
    }

    abstract fun getViewBinding(): VB

    abstract fun initData()
}